
using System;
namespace ibba.src.norisk.Web
{
    public partial class _default1 : System.Web.UI.Page
    {
        public string SilverlightInitParams { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {

            if (User != null && User.Identity != null && User.Identity.IsAuthenticated)
            {

                System.Security.Principal.WindowsIdentity wi = System.Security.Principal.WindowsIdentity.GetCurrent();
                string[] a = Context.User.Identity.Name.Split('\\');

                System.DirectoryServices.DirectoryEntry ADEntry = new System.DirectoryServices.DirectoryEntry("WinNT://" + a[0] + "/" + a[1]);

                this.SilverlightInitParams = string.Format("User.Identity.Name={0},Server.MachineName={1},IdSistema={2},FullName={3},XML_Servidores={4}",
                                                        User.Identity.Name, Server.MachineName,
                                                        System.Configuration.ConfigurationManager.AppSettings["IdSistema"],
                                                        ADEntry.Properties["FullName"].Value.ToString(),
                                                        System.Configuration.ConfigurationManager.AppSettings["XML_Servidores"]);


            }

        }
    }
}
